package com.qf.md.item.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.qf.common.PageParam;
import com.qf.common.PageVO;
import com.qf.md.item.dao.MdItemDAO;
import com.qf.md.item.service.MdItemService;
import com.qf.md.item.vo.ItemVO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * ==== 天道酬勤 ====
 *
 * @author douzhouzhou
 * @date 2025/3/3
 * <p>
 * ==== 行稳致远 进而有为 ====
 */
@Service
public class MdItemServiceImpl implements MdItemService {
@Resource
    private MdItemDAO mdItemDAO;
    @Override
    public PageVO<ItemVO> findItemVO(PageParam pageParam) {
        PageHelper.startPage(pageParam.getPageNum(), pageParam.getPageSize());
        List<ItemVO> list = mdItemDAO.selectItemVO();
        PageInfo<ItemVO> pageInfo = new PageInfo<>(list);
        return new PageVO<>(pageInfo.getTotal(), pageInfo.getList());
    }
}
